package com.earstep.threadpool;


public class TimerCtl {

	public static TimerTasks timerTasks;

	public TimerCtl() {
	}

	/*
	 * 单例启动线程 加入一个任务
	 */
	public static void startTimer(TimerRunnable client) {
		if (timerTasks == null) {
			timerTasks = new TimerTasks();
			timerTasks.start();
		}
		// 将当前任务添加进入 任务列表
		timerTasks.add(client);
	}

	/*
	 * 删除指定的任务
	 */
	public static void stopTimer(TimerRunnable client) {
		if (timerTasks != null)
			timerTasks.end(client);
	}

	/*
	 * 暂停指定的任务
	 */
	public static void suspended(TimerRunnable client) {
		if (timerTasks != null)
			timerTasks.suspended(client);
	}

	/*
	 * 指定的任务解除暂停
	 */
	public static void start(TimerRunnable client) {
		if (timerTasks != null)
			timerTasks.start(client);
	}

}
